<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:insert="commen/head :: header">
    </div>
    <script type="text/javascript">
        window.onload = function () {
            var updateBtn = document.getElementById("updateBtn")
            updateBtn.onclick = function () {
                alert("修改成功");
            }
        }
    </script>
</head>
<body  style="background-color: rgb(242,244,247)">
<div th:insert="commen/navigationBar :: topNavBar"></div>
    <div class="container" style="background-color: #ffffff; border-radius: 15px; margin-top: 15px;padding: 15px;">
      <div class="row">
        <div class="col-md-6">
          <div th:if="${session.course}">
            <img th:src="@{'../img/' + ${session.course.courseImg}}" alt="" style="width: 285px; height: 190.55px;">
          </div>
          <div>
            <form th:action="@{/uploadCourseImg}" method="post" enctype="multipart/form-data">
              <span style="font-size: 18px">课程封面</span><input type="file" name="courseImg"><br>
              <input type="submit" value="上传">
            </form>

          </div>
        </div>

        <div class="col-md-6">
          <h2>课程资料</h2>
          <form th:action="@{/updateTeacherName}" method="post">
<!--            <input type="hidden" name="courseId" th:value="${session.course.courseId}">-->
            <input type="hidden" name="_method" value="PUT">
            <span style="font-size: 18px">课程名称:</span><input style="font-size: 18px" type="text" readonly="readonly" th:value="${session.course.courseName}"> <br>
            <span style="font-size: 18px">课程邀请码: </span><span style="font-size: 18px" th:text="${session.course.invitationCode}"></span><br>
            <span style="font-size: 18px">任课老师:</span><input style="font-size: 18px" type="text" name="courseTeacherName" th:value="${session.course.courseTeacherName}"> <br>
            <input class="btn-success btn" type="submit" id="updateBtn" th:value="修改">
          </form>
        </div>
      </div>
    </div>
</body>
</html>